package com.ssy.lingxi.platform.manage.repository;


import com.ssy.lingxi.platform.manage.entity.content.ContentColumn;
import com.ssy.lingxi.platform.manage.entity.content.MemberColumn;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MemberColumnRepository extends JpaRepository<MemberColumn, Long>, JpaSpecificationExecutor<MemberColumn> {

    List<MemberColumn> findAllByMemberIdAndMemberRoleIdAndStatusAndType(Long memberId, Long memberRoleId, Integer status, Integer type, Sort sort);

    boolean existsByMemberIdAndMemberRoleIdAndSortAndType(Long memberId, Long memberRoleId, Integer sort, Integer type);

    MemberColumn findByMemberIdAndMemberRoleIdAndSortAndType(Long memberId, Long memberRoleId, Integer sort, Integer type);

    List<MemberColumn> findAllByMemberIdAndMemberRoleIdAndStatusAndType(Long memberId, Long memberRoleId, Integer code, Integer type);

    List<MemberColumn> findAllByMemberIdAndMemberRoleIdAndStatus(Long memberId, Long memberRoleId, Integer status, Sort sort);

    List<MemberColumn> findAllByMemberIdAndMemberRoleIdAndNameContainingAndStatus(Long memberId, Long memberRoleId, String name, Integer status);

    List<MemberColumn> findAllByMemberIdAndMemberRoleId(Long memberId, Long memberRoleId);

    List<MemberColumn> findAllByStatus(Integer code, Sort sort);

    List<MemberColumn> findAllByNameContainingAndStatus(String keyword, Integer code);
}
